package com.ruoyi.demo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.demo.domain.vo.inviteVo;
import com.ruoyi.demo.domain.vo.meetDetailVO;
import com.ruoyi.demo.mapper.MeetDetailMapper;
import com.ruoyi.demo.mapper.inviteUserMapper;
import com.ruoyi.demo.service.IInviteUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class inviteUserServiceImpl extends ServiceImpl<inviteUserMapper, inviteVo> implements IInviteUserService {

    @Resource
    private inviteUserMapper inviteUserMapper;
    @Override
    public List<inviteVo> getInviteByInviteeId(int inviteeId) {
        return inviteUserMapper.getInviteByInviteeId(inviteeId);
    }

    @Override
    public inviteVo getInviteByInviterIdAndMeetId(int inviterId, int meetId,Long userId) {
        return inviteUserMapper.getInviteByInviterIdAndMeetId(inviterId,meetId,userId);
    }

    @Override
    public Boolean updateInviteStatus(int inviteeId, int meetId) {
        inviteUserMapper.insertMeetUser(inviteeId,meetId);
        return inviteUserMapper.updateInviteStatus(inviteeId,meetId)>0;
    }

    @Override
    public List<inviteVo> getInviteBySearch(String item,Long userId) {
        return inviteUserMapper.getInviteBySearch(item,userId);
    }
}
